echo=1/*>nul&@cls
@echo off & title %1
if not exist %1 mkdir %1
cd %1
echo %1
echo %2
call :http %2
exit

:http
set SourceUrl=%~1
for %%a in ("%SourceUrl%") do (
set FileName=%%~nxa
)
echo %FileName%
if exist %FileName% goto :eof
cscript -nologo -e:jscript "%~f0" "%SourceUrl%" "%FileName%.tmp"
if not exist "%FileName%.tmp" echo >"%FileName%"
if exist "%FileName%.tmp" ren "%FileName%.tmp" "%FileName%"
goto :eof
*/
var iLocal,iRemote,xPost,sGet;
iLocal=WScript.Arguments(1);
iRemote=WScript.Arguments(0);
iLocal=iLocal.toLowerCase();
iRemote=iRemote.toLowerCase();
xPost=new ActiveXObject("Microsoft"+String.fromCharCode(0x2e)+"XMLHTTP");
xPost.Open("GET",iRemote,0);
xPost.Send();
sGet=new ActiveXObject("ADODB"+String.fromCharCode(0x2e)+"Stream");
sGet.Mode=3;
sGet.Type=1;
sGet.Open();
sGet.Write(xPost.responseBody);
sGet.SaveToFile(iLocal,2);